package com.tz.crm.entity.dto;

import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Pattern;

/**
 * Created by wangchunyang on 2017/3/7.
 * 密码的封装
 */
public class Password {

    @NotBlank(message = "请输入原密码")
    String oldPassword;

    @NotBlank(message = "请输入新密码")
    @Pattern(regexp = "^[a-zA-Z0-9]{6,16}?$", message = "密码必须6~16位，包含字母和数字")
    String newPassword;

    @NotBlank(message = "请确认新密码")
    String confirmPassword;

    public Password() {

    }

    public String getOldPassword() {
        return oldPassword;
    }

    public void setOldPassword(String oldPassword) {
        this.oldPassword = oldPassword;
    }

    public String getNewPassword() {
        return newPassword;
    }

    public void setNewPassword(String newPassword) {
        this.newPassword = newPassword;
    }

    public String getConfirmPassword() {
        return confirmPassword;
    }

    public void setConfirmPassword(String confirmPassword) {
        this.confirmPassword = confirmPassword;
    }

    @Override
    public String toString() {
        return "Password{" +
                "oldPassword='" + oldPassword + '\'' +
                ", newPassword='" + newPassword + '\'' +
                ", confirmPassword='" + confirmPassword + '\'' +
                '}';
    }
}
